package com.util;

import java.io.Serializable;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
 * @author Administrator
 *閸掑棝銆夊銉ュ徔,闂堢偛宕熸笟锟�
 */
@Component
@Scope("prototype")
public class PageUtilLei implements Serializable {
	private Integer pageNum;
    private Integer pageSize;
    private Integer totalNum;
    private Integer totalPage;
    private Integer startNum;
    private Integer endNum;

    
 /*   private String  d_id;
    private String id;
    private String r_id;
    private String u_nickName;
    private String d_name;
    private String min_u_age;
    private String max_u_age;
    */
    
    
    public PageUtilLei()
    {
        
    }
    
    public PageUtilLei(Integer pageNum,Integer pageSize,Integer totalNum,PageUtilLei page)
    {
    	/*this.setD_id(page.getD_id());
    	this.setId(page.getId());
    	this.setR_id(page.getR_id());
    	this.setMin_u_age(page.getMin_u_age());
    	this.setMax_u_age(page.getMax_u_age());
    	
    	this.setD_name(page.getD_name());
    	this.setU_nickName(page.getU_nickName());*/
    	
        if(pageNum == null || pageNum == 0)
        {
            this.pageNum = 1;
        }
        else
        {
            this.pageNum = pageNum;
        }
        if(pageSize == null || pageSize == 0)
        {
            this.pageSize = 1;
        }
        else
        {
            this.pageSize = pageSize;
        }
        
        this.startNum = (this.pageNum-1)*this.pageSize+1;
        this.endNum = this.pageNum*this.pageSize;
        if(totalNum == null)
        {
            totalNum = 0;
        }
        this.totalNum = totalNum;
        this.totalPage = this.totalNum/this.pageSize; 
        if(this.totalNum % this.pageSize != 0)
        {
            this.totalPage++;
        }
    }

    public Integer getPageNum()
    {
        return pageNum;
    }

    public Integer getPageSize()
    {
        return pageSize;
    }

    public Integer getTotalNum()
    {
        return totalNum;
    }

    public Integer getTotalPage()
    {
        return totalPage;
    }

    public Integer getStartNum()
    {
        return startNum;
    }

    public Integer getEndNum()
    {
        return endNum;
    }
    public void setPageNum(Integer pageNum)
    {
        this.pageNum = pageNum;
    }
    public void setPageSize(Integer pageSize)
    {
        this.pageSize = pageSize;
    }



}
